﻿using BCCommon.Enums;
using BCCommon.Enums.Driver;
using BCCommon.Extensions;
using BCCommon.TMS.Driver;
using BCDto.TMS.Agent.AgentRecord;
using BCDto.TMS.Fence;
using System;

namespace BCDto.TMS.Driver
{
    /// <summary>
    /// 司机信息
    /// </summary>
    public class DriverDto
    {
        /// <summary>
        /// 司机信息Id
        /// </summary>
        public long DriverId { get; set; }
        /// <summary>
        /// 司机手机号
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 司机姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public Sex Sex { get; set; }
        /// <summary>
        /// 性别(男,女)
        /// </summary>
        public string SexStr { get { return this.Sex.GetDescriptionString(); } }
        /// <summary>
        /// 车牌号
        /// </summary>
        public string VehicleNo { get; set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        public long UserId { get; set; }
        /// <summary>
        /// 车型Id
        /// </summary>
        public int VehicleTypeId { get; set; }
        /// <summary>
        /// 车型
        /// </summary>
        public string VehicleType { get; set; }
        /// <summary>
        /// 车型分类（对应字典引用检索键）
        /// </summary>		
        public string VehicleCategory { get; set; }
        /// <summary>
        /// 车型分类名称
        /// </summary>		
        public string VehicleCategoryName { get; set; }
        /// <summary>
        /// 车辆载重量
        /// </summary>
        public int VehicleWeight { get; set; }

        /// <summary>
        /// 车辆长度
        /// </summary>
        public decimal VehicleLength { get; set; }

        /// <summary>
        /// 车辆宽度
        /// </summary>
        public decimal VehicleWidth { get; set; }

        /// <summary>
        /// 车辆高度
        /// </summary>
        public decimal VehicleHeight { get; set; }

        /// <summary>
        /// 车辆载货立方
        /// </summary>
        public decimal VehicleStere { get; set; }

        /// <summary>
        /// 驾驶证正面图片
        /// </summary>
        public string DriverLicense { get; set; }
        /// <summary>
        /// 驾驶证副页图片
        /// </summary>
        public string DriverLicenseDeputyPage { get; set; }
        /// <summary>
        /// 行驶证正面图片
        /// </summary>
        public string VehicleLicense { get; set; }
        /// <summary>
        /// 行驶证车照图片
        /// </summary>
        public string VehicleLicenseDeputyPage { get; set; }
        /// <summary>
        /// 司机照片地址
        /// </summary>
        public string DriverPhotoPath { get; set; }
        /// <summary>
        /// 车辆照片(前方)地址
        /// </summary>
        public string VehiclePhotoFrontPath { get; set; }
        /// <summary>
        /// 车辆照片(背后)地址
        /// </summary>
        public string VehiclePhotoBackPath { get; set; }
        /// <summary>
        /// 车辆保险单地址
        /// </summary>
        public string CarInsurancePolicy { get; set; }
        /// <summary>
        /// 商业保险地址
        /// </summary>
        public string BusinessInsurance { get; set; }
        /// <summary>
        /// 是否接受指派
        /// </summary>
        public bool IsAcceptAssign { get; set; }
        /// <summary>
        /// 是否接收零担推送
        /// </summary>
        public bool IsReceivePartLoad { get; set; }
        /// <summary>
        /// 身份证号
        /// </summary>
        public string IdentityCardNo { get; set; }
        /// <summary>
        /// 身份证图片地址
        /// </summary>
        public string IdentityCardPath { get; set; }
        /// <summary>
        /// 身份证背面图片地址
        /// </summary>
        public string IdentityCardBackPath { get; set; }
        /// <summary>
        /// 司机状态(待审核,审核通过,已拒绝)
        /// </summary>
        public DriverStatus DriverStatus { get; set; }
        /// <summary>
        /// 司机状态(待审核,审核通过,已拒绝)
        /// </summary>
        public string DriverStatusStr { get { return this.WorkingStatus.GetDescriptionString(); } }
        /// <summary>
        /// 拒绝原因
        /// </summary>
        public string RefuseToReason { get; set; }
        /// <summary>
        /// 工作状态(工作中,休息中,已停运)
        /// </summary>
        public DriverWorkingStatus WorkingStatus { get; set; }
        /// <summary>
        /// 工作状态(工作中,休息中,已停运)
        /// </summary>
        public string WorkingStatusStr
        {
            get
            {
                return this.WorkingStatus.GetDescriptionString();
            }
        }
        /// <summary>
        /// 公司Id
        /// </summary>
        public long? CompanyId { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { get; set; }
        /// <summary>
        /// 紧急联系电话
        /// </summary>
        public string EmergencyPhone { get; set; }
        /// <summary>
        /// 司机等级
        /// </summary>
        public GradeType DriverLevel { get; set; }
        /// <summary>
        /// 司机等级
        /// </summary>
        public string DriverLevelStr
        {
            get
            {
                return this.DriverLevel.GetDescriptionString();
            }
        }
        /// <summary>
        /// 收益
        /// </summary>
        public decimal Income { get; set; }
        /// <summary>
        /// 是否已培训
        /// </summary>
        public bool IsTrained { get; set; }
        /// <summary>
        /// 是否培训通过
        /// </summary>
        public bool IsTrainPassed { get; set; }
        /// <summary>
        ///  培训通过时间
        /// </summary>
        public DateTime? TrainPassedTime { get; set; }
        /// <summary>
        /// 车头人照片地址
        /// </summary>
        public string PersonCarPhoto { get; set; }
        /// <summary>
        /// 信用值
        /// </summary>
        public decimal? CreditScore { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? ApproveTime { get; set; }
        /// <summary>
        /// 审核人名称
        /// </summary>
        public string Approver { get; set; }
        /// <summary>
        /// 审核人Id
        /// </summary>
        public long? ApproverId { get; set; }
        /// <summary>
        /// 是否使用计费规则
        /// </summary>
        public bool IsUseBillingRules { get; set; }
        /// <summary>
        /// 司机来源
        /// </summary>
        public DriverSourceType Source { get; set; }
        /// <summary>
        /// 司机来源（系统、司机端）
        /// </summary>
        public string SourceStr
        {
            get
            {
                return this.Source.GetDescriptionString();
            }
        }
        /// <summary>
        /// 注册省份Id
        /// </summary>
        public long ProvinceId { get; set; }
        /// <summary>
        /// 注册省份编码
        /// </summary>
        public string ProvinceCode { get; set; }
        /// <summary>
        /// 注册省份名称
        /// </summary>
        public string ProvinceName { get; set; }
        /// <summary>
        /// 注册城市Id
        /// </summary>
        public long CityId { get; set; }
        /// <summary>
        /// 注册城市编码
        /// </summary>
        public string CityCode { get; set; }
        /// <summary>
        /// 注册城市名称
        /// </summary>
        public string CityName { get; set; }
        /// <summary>
        /// 注册区县Id
        /// </summary>
        public long CountyId { get; set; }
        /// <summary>
        /// 注册区/县编码
        /// </summary>
        public string CountyCode { get; set; }
        /// <summary>
        /// 注册区县名称
        /// </summary>
        public string CountyName { get; set; }
        /// <summary>
        /// 个人保险单信息Id
        /// </summary>
        public long PersonalInsuranceRecordId { get; set; }
        /// <summary>
        /// 电子围栏Id
        /// </summary>
        public long? ElectricFenceId { get; set; }
        /// <summary>
        /// 是否是保利润
        /// </summary>
        public bool IsGuaranteedProfit { get; set; }
        /// <summary>
        /// 配送箱长
        /// </summary>
        public long DeliveryBoxLength { get; set; }
        /// <summary>
        /// 配送箱宽
        /// </summary>
        public long DeliveryBoxWidth { get; set; }
        /// <summary>
        /// 配送箱高
        /// </summary>
        public long DeliveryBoxHeight { get; set; }
        /// <summary>
        /// 角色(货车司机,跑腿,骑手)
        /// </summary>
        public DriverRoleType? Role { get; set; }
        /// <summary>
        /// 司机角色
        /// </summary>
        public string RoleStr => this.Role.HasValue ? this.Role.GetDescriptionString() : string.Empty;
        /// <summary>
        /// 是否实名认证
        /// </summary>
        public bool IsRealNameVerified { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }
        /// <summary>
        /// 是否人脸识别认证
        /// </summary>
        public bool IsFaceVerified { get; set; }
        /// <summary>
        /// 用户人脸照
        /// </summary>
        public string FacePic { get; set; }
        /// <summary>
        /// 实名认证拒绝原因
        /// </summary>
        public string RealNameVerifiesRefuse { get; set; }
        /// <summary>
        /// 人脸识别认证拒绝原因
        /// </summary>
        public string FaceVerifiesRefuse { get; set; }
        /// <summary>
        /// 健康证类型
        /// </summary>
        public DriverHealthCertificateType? HealthCertificateType { get; set; }

        /// <summary>
        /// 健康证类型（卡制、本制、纸制、电子）
        /// </summary>
        public string HealthCertificateTypeStr
        {
            get
            {
                return this.HealthCertificateType.HasValue ? this.HealthCertificateType.Value.GetDescriptionString() : string.Empty;
            }
        }
        /// <summary>
        /// 健康证
        /// </summary>
        public string HealthCertificate { get; set; }

        /// <summary>
        /// 实名认证状态
        /// </summary>
        public RealNameVerifiesStatus RealNameVerifiesStatus { get; set; }
        /// <summary>
        /// 实名认证状态
        /// </summary>
        public string RealNameVerifiesStatusStr { get; set; }
        /// <summary>
        /// 是否安全培训考试通过
        /// </summary>
        public bool IsLearnTrainPassed { get; set; }
        /// <summary>
        /// 安全培训考试通过时间
        /// </summary>
        public DateTime? LearnTrainPassedTime { get; set; }
        /// <summary>
        /// 劳务公司Id
        /// </summary>
        public long? WorkingCompanyId { get; set; }
        /// <summary>
        /// 劳务公司名称
        /// </summary>
        public string WorkingCompanyName { get; set; }
        /// <summary>
        /// 围栏信息
        /// </summary>
        public FenceDto Fence { get; set; }
        /// <summary>
        /// 代理商信息
        /// </summary>
        public AgentRecordViewDto AgentRecord { get; set; }
        /// <summary>
        /// 代理商Id
        /// </summary>
        public long? AgentRecordId { get; set; }

        #region 接单数量信息
        /// <summary>
        /// 日接单数
        /// </summary> 
        public int DailyReceivedOrders { get; set; }

        /// <summary>
        /// 总接单数
        /// </summary> 
        public int TotalReceivedOrders { get; set; }

        /// <summary>
        /// 满载率
        /// </summary>  
        public decimal FullLoadRatio { get; set; }
        #endregion
    }
}
